/*let a =[1,2,3,"123",12.3];
//console.log(a);
for (let b=0;b<a.length;b++){
    console.log(a[b]);
}
let a = [[1,2,3],[4,5,6],[7,8,9]];
for (let b=0;b<a.length;b++){
    for (let c=0;c<a[b].length;c++){
        console.log(a[b][c]);
    }
}

let a = [[[1.1,1.2,1.3],[2.1,2.2,2.3],[3.1,3.2,3.3]]];
    for (let b=0;b<a.length;b++){
        for (let c=0;c<a[b].length;c++){
            for (let d=0;d<a[b][c].length;d++){
                console.log(a[b][c][d]);
            }
        }
}

let a =[];
//a.push(123,"123",1.2);
//console.log(a);
for(let b=1;b<=20;b++){
    a.push(b)
}
console.log(a);

function max(a,b){
    if(a<b){
        return b;
    }else{
        return a;
    }
}
console.log(max(20,50));

let x = Math.max(20,50);
console.log(x);

function min(a,b){
    if(a>b){
        return b;
    }else{
        return a;
    }
}
console.log(min(20,50));

let y = Math.min(20,50);
console.log(y);

function maxAccount(a,b){
    if(a.length>b.length){
        return a
    }else{
        return b
    }
}
console.log(maxAccount("123456","123456789"))
function maxAccount(a,b){
    return a.length > b.length ? a : b
}
console.log(maxAccount("123456","123456789"))
function maxAccount(a,b){
    if(typeof a === "string" && typeof b === "string"){
        return a.length > b.length ? a : b
    }else{
        return"非字符串类型，使用错误"
    }
}
console.log(maxAccount("abcd","efg"))
console.log(maxAccount(15,20))
console.log(maxAccount("abcd",20))

let x = ()=>{

}

function printName(name){
    if(typeof name === "string"){
        console.log("你好",name)
    }else{
        console.log("你输入的不是字符串")
    }
 }
printName("小董")

let printName=(name)=>{
    typeof name ==="string" ? console.log("你好",name):console.log("你输入的不是字符串")
}
printName("小董")

function a(){
    return "abc"
}
console.log(a())
function b(){
    console.log("abc")
}
b()

const max = (a,b) => a > b ? a : b

function max(a,b){
    return a > b ? a : b
}
console.log(max(20,80))

const showName = (name) => "你好" + name
console.log(showName("Jack"))

const findName = (array) =>{
    for(let a=0;a<array.length;a++){
        if(array[a]==="Bob"){
            return a
        }
    }
    return "没有找到名字"
}
console.log(findName([2,12,"Bob",true]))

const findName = (array) =>
array.indexOf("Bob") !== -1 ? array.indexOf("Bob") : "没有找到名字"

console.log(findName([1,23,12,"Bob",true]))

let a = {
    name:"水星",
    size:2000000
}
console.log(a.name)
console.log(a["name"])
a.color = "blue"
a["color"] = "red"
console.log(a.color)
console.log(a.name,a.color)

let a = {
    name:"汤雅洁",
    age:19,
    gender:"女"
}
for (let s in a){//只获取value值
    console.log(a[s])
}
for (let s in a){//只获取key值
    console.log(s)
}
for(let s of Object.keys(a)){//只获取value值
    console.log(s)
}
for(let s of Object.values(a)){//只获取key值
    console.log(s)
}
for(let [k,v] of Object.entries(a)){//两个都获取
    console.log(k,v)
}

let a = {
    name:"汤雅洁",
    age:19,
    gender:"女"
}
let b = {
    name:"小董不懂事",
    age:19,
    gender:"女"
}
let c = {
    name:"阿康爱上了阿强",
    age:19,
    gender:"男"
}

function showObj(obj){
    for(let [k,v] of Object.entries(obj)){
        console.log(k,v)
    }
}
showObj(a)
showObj(b)
showObj(c)


let a = [
    {
        name: "阿康爱上了阿强",
        age: 19,
        gender: "男"
    }, {
        name: "阿康爱上了阿强",
        age: 19,
        gender: "男"
    }
]
const showObj = (objArr) => {

        for (let b = 0; b < objArr.length; b++) {

            for (let [k, v] of Object.entries(objArr[b])) {
                console.log(k, v)
            }
        }
    }

let s1 = {
    name: "汤雅洁",
    age: 19,
    gender: "女"
}
let s2 = {
    name: "小董不懂事",
    age: 19,
    gender: "女"
}
let a = [s1, s2]
let b = [s1, s2]
const showObj = (objArr) => {
    for (let b = 0; b < objArr.length; b++) {

        for (let [k, v] of Object.entries(objArr[b])) {
            console.log(v)
        }
    }
}
showObj(a)

let s1 = {
    name: "汤雅洁",
    age: 19,
    gender: "女",
    work: function () {
        console.log(this.name, "开始工作")
    },
    stop: function () {
        console.log(this.name, "结束工作")
    }
}
s1.work()
s1.stop()
*/
console.log("小糖");



